﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/QuizAdmin.Master" AutoEventWireup="true" CodeBehind="ViewQuestionLevels.aspx.cs" Inherits="BladeTecWebApplication.Admin.ViewQuestionLevels" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

<script type="text/javascript">

    function confirmDelete(confirmed) {

        if (!confirmed) {
            $("#dialog-confirm").dialog({
                resizable: false,
                height: 200,
                width: 400,
                modal: true,
                buttons: {
                    "Delete Level(s)": function () {
                        $(this).dialog("close");
                        $("#MainContent_deleteButtonHidden").click();
                    },
                    Cancel: function () {
                        $(this).dialog("close");
                    }
                }
            });
            return false;
        } else {
            return true;
        }

    }

</script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<asp:Panel runat="server" ID="pnlQuestionLevels">
<span class="pageTitle">View Question Levels</span>
<br /><br />

	<!--
	<asp:Panel cssclass="ui-widget" runat="server" Visible="false" ID="pnlErrorDelete1">
		<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"> 
			<p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> 
			<strong>One or more quizzes could not be deleted because they are still associated with positions.</strong>
			</p>
		</div>
		<br />
	</asp:Panel>
	-->

    <asp:GridView ID="gvQuestionLevels" runat="server" 
        AlternatingRowStyle-CssClass="netsysTableRowAlt" AutoGenerateColumns="false" 
        BorderStyle="None" BorderWidth="0" CssClass="netsysTable" 
        RowStyle-CssClass="netsysTableRow" Width="100%">
        <Columns>
            <asp:TemplateField>
                <ItemTemplate>
                    <input type="checkbox" name="level_<%#Eval("LEVEL_ID") %>" value="<%#Eval("LEVEL_ID") %>" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="LEVEL_DESCRIPTION" HeaderText="Level Description" />
            <asp:BoundField DataField="LEVEL_WEIGHT" HeaderText="Level Weight" />
            <asp:TemplateField HeaderText="">
                <ItemTemplate>
                    <a href="EditQuestionLevels.aspx?LEVEL_ID=<%#Eval("LEVEL_ID") %>">Edit</a>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    
	<div style="width:100%; margin-top: 10px;">
		<asp:Button ID="btnDelete" runat="server" Text="Delete Selected" 
			onclick="btnDelete_Click" OnClientClick="return confirmDelete(false);" 
			ClientIDMode="Predictable" />
		<div style="display:none">
			<asp:Button runat="server" OnClick="btnDelete_Click" ID="deleteButtonHidden" ClientIDMode="Predictable"/>
		</div>
	</div>

	<div id="dialog-confirm" title="Confirm Delete" style="display:none;">
		<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>Are you sure you want to delete the selected question level(s)?</p>
	</div>

</asp:Panel>

</asp:Content>
